<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" v-model="info">
    <!--事件绑定  简写-->
    <input type="button" value="按钮1" @click="f()">
    <!--事件绑定-->
    <input type="button" value="按钮2" v-on:click="f1()">
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            info:""
        },
        methods: {
            f() {
                // let i1 = document.querySelector("#i1");
                alert(v.info);
            },
            f1() {
                alert("按钮2点击了")
            }
        }
    })
</script>
</body>
</html>